package com.zh.article;

import com.zh.Scene;
import com.zh.creature.Creature;
import com.zh.creature.PersonSet;

/**
 * @description:
 * @author: zhangHang
 * @date: Created in 2020/6/1 16:06
 * @version: 1.0
 * @modified By:
 */
public class Teleport extends SpecialSkill{
    public Teleport() {
    }

    public Teleport(String id, String description) {
        super(id, description);
    }

    @Override
    public void useSpecialSkill(Creature targetCreature, PersonSet personSet, String id, Scene scene) {
        if(this.getFlag()>0){
            targetCreature.setCurrentRoom(scene.getRoomSet().searchRoomById(id));//主角
            for (Creature item:personSet.getPeople()
                 ) {
                item.setCurrentRoom(scene.getRoomSet().searchRoomById(id));//帮手一起
            }
            this.setFlag(this.getFlag()-1);
        }else{
            System.out.println("此特殊技能使用次数已经用完。");
        }

    }
}
